#include "board.h"


int main(int argc, char const *argv[])
{
    pthread_t a;
    pthread_create(&a, NULL, board_TCP, NULL); 

    list head = init_list();
    char buff[50];
    while(1)
    {
        if(strlen(buf) != 0 && num_tcp == 1)//添加患者
        {
            if(add_node(head, new_node(num_tcp, name_tcp)) == false)
            {
                strcpy(buff, "人已满");
                write(connfd, buff, strlen(buff));
                printf("人已满\n");

            }
            show(head);
        }
        else if(strlen(buf) != 0 && num_tcp == 2)//叫下一位
        {
            if(del_node(head) == false)
            {
                strcpy(buff, "已无人");
                write(connfd, buff, strlen(buff));                                
                printf("已无人\n");
            }
            show(head);
        }
        bzero(buf, 50);
        bzero(buff, 50);
    }
    

    return 0;
}
